﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace c_Windows
{
    public partial class Key : Form
    {
        public Key()
        {
            InitializeComponent();
        }

        private void Key_Load(object sender, EventArgs e)
        {

        }

        private void Key_KeyPress(object sender, KeyPressEventArgs e)
        {

            DisplayKeya.Text = "按键名称：" + e.KeyChar; 
        }

        private void Key_KeyDown(object sender, KeyEventArgs e)
        {
            DisplayKeyb.Text = "Alt:" + (e.Alt ? "Yes" : "No") + "\n" + "Shift:" + (e.Shift ? "Yes" : "No") + "\n" + "Ctrl:" + (e.Alt ? "Yes" : "No") + "\n" + "KeyCode:" + e.KeyCode + "\n" + "KeyData:" + e.KeyData + "\n" + "KeyValue:" + e.KeyValue + "\n" ;
        }
        
    }
}